import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
// 导入待注册的插件即可完成全局组件、过滤器、指令的自动注册
import plugins from './plugins'
Vue.use(plugins)
// 注册打印指令
import Print from 'vue-print-nb'
Vue.use(Print)

// 导入lang
import i18n from '@/lang'
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n, // 将i18n对象挂载到Vue的实例上，将来就可以使用$t(key)来进行语言包的设置,key就是语言包中属性名
  render: h => h(App)
})
